Integrand size = 36, antiderivative size = 319 \[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=-\frac {\left (\frac {1}{16}-\frac {i}{16}\right ) ((2+7 i) A-(23+2 i) B) \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^2 d}+\frac {((9+5 i) A-(25-21 i) B) \arctan \left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{16 \sqrt {2} a^2 d}+\frac {5 (i A-5 B)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}-\frac {\left (\frac {1}{32}-\frac {i}{32}\right ) ((7+2 i) A+(2+23 i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{\sqrt {2} a^2 d}+\frac {\left (\frac {1}{32}-\frac {i}{32}\right ) ((7+2 i) A+(2+23 i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{\sqrt {2} a^2 d} \]
[Out]
Time = 1.07 (sec) , antiderivative size = 319, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3662, 3677, 3610, 3615, 1182, 1176, 631, 210, 1179, 642} \[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=-\frac {\left (\frac {1}{16}-\frac {i}{16}\right ) ((2+7 i) A-(23+2 i) B) \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^2 d}+\frac {((9+5 i) A-(25-21 i) B) \arctan \left (\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{16 \sqrt {2} a^2 d}+\frac {5 (-5 B+i A)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (\cot (c+d x)+i)}-\frac {\left (\frac {1}{32}-\frac {i}{32}\right ) ((7+2 i) A+(2+23 i) B) \log \left (\cot (c+d x)-\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{\sqrt {2} a^2 d}+\frac {\left (\frac {1}{32}-\frac {i}{32}\right ) ((7+2 i) A+(2+23 i) B) \log \left (\cot (c+d x)+\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{\sqrt {2} a^2 d}+\frac {-B+i A}{4 d \sqrt {\cot (c+d x)} (a \cot (c+d x)+i a)^2} \]
[In]
[Out]
Rule 210
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 1182
Rule 3610
Rule 3615
Rule 3662
Rule 3677
Rubi steps \begin{align*} \text {integral}& = \int \frac {B+A \cot (c+d x)}{\cot ^{\frac {3}{2}}(c+d x) (i a+a \cot (c+d x))^2} \, dx \\ & = \frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}+\frac {\int \frac {-\frac {1}{2} a (A+9 i B)-\frac {5}{2} a (i A-B) \cot (c+d x)}{\cot ^{\frac {3}{2}}(c+d x) (i a+a \cot (c+d x))} \, dx}{4 a^2} \\ & = \frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}+\frac {\int \frac {\frac {5}{2} a^2 (i A-5 B)-\frac {3}{2} a^2 (3 A+7 i B) \cot (c+d x)}{\cot ^{\frac {3}{2}}(c+d x)} \, dx}{8 a^4} \\ & = \frac {5 (i A-5 B)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}+\frac {\int \frac {-\frac {3}{2} a^2 (3 A+7 i B)-\frac {5}{2} a^2 (i A-5 B) \cot (c+d x)}{\sqrt {\cot (c+d x)}} \, dx}{8 a^4} \\ & = \frac {5 (i A-5 B)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}+\frac {\text {Subst}\left (\int \frac {\frac {3}{2} a^2 (3 A+7 i B)+\frac {5}{2} a^2 (i A-5 B) x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{4 a^4 d} \\ & = \frac {5 (i A-5 B)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}+\frac {((9+5 i) A-(25-21 i) B) \text {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{16 a^2 d}+\frac {((9-5 i) A+(25+21 i) B) \text {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{16 a^2 d} \\ & = \frac {5 (i A-5 B)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}+\frac {((9+5 i) A-(25-21 i) B) \text {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 a^2 d}+\frac {((9+5 i) A-(25-21 i) B) \text {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 a^2 d}-\frac {((9-5 i) A+(25+21 i) B) \text {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 \sqrt {2} a^2 d}-\frac {((9-5 i) A+(25+21 i) B) \text {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 \sqrt {2} a^2 d} \\ & = \frac {5 (i A-5 B)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}-\frac {((9-5 i) A+(25+21 i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^2 d}+\frac {((9-5 i) A+(25+21 i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^2 d}+\frac {((9+5 i) A-(25-21 i) B) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{16 \sqrt {2} a^2 d}-\frac {((9+5 i) A-(25-21 i) B) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{16 \sqrt {2} a^2 d} \\ & = -\frac {((9+5 i) A-(25-21 i) B) \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{16 \sqrt {2} a^2 d}+\frac {((9+5 i) A-(25-21 i) B) \arctan \left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{16 \sqrt {2} a^2 d}+\frac {5 (i A-5 B)}{8 a^2 d \sqrt {\cot (c+d x)}}+\frac {3 A+7 i B}{8 a^2 d \sqrt {\cot (c+d x)} (i+\cot (c+d x))}+\frac {i A-B}{4 d \sqrt {\cot (c+d x)} (i a+a \cot (c+d x))^2}-\frac {((9-5 i) A+(25+21 i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^2 d}+\frac {((9-5 i) A+(25+21 i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^2 d} \\ \end{align*}
Time = 4.94 (sec) , antiderivative size = 215, normalized size of antiderivative = 0.67 \[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=-\frac {\sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)} \left (-2 \sqrt [4]{-1} (i A+B) \arctan \left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right ) \sec ^2(c+d x) (\cos (2 (c+d x))+i \sin (2 (c+d x)))+(-1)^{3/4} (7 A+23 i B) \text {arctanh}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right ) \sec ^2(c+d x) (\cos (2 (c+d x))+i \sin (2 (c+d x)))+\sqrt {\tan (c+d x)} \left (5 i (A+5 i B)-(7 A+43 i B) \tan (c+d x)+16 B \tan ^2(c+d x)\right )\right )}{8 a^2 d (-i+\tan (c+d x))^2} \]
[In]
[Out]
Time = 0.45 (sec) , antiderivative size = 157, normalized size of antiderivative = 0.49
method | result | size |
derivativedivides | \(\frac {-\frac {i \left (-i B +A \right ) \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}-i \sqrt {2}}\right )}{2 \left (\sqrt {2}-i \sqrt {2}\right )}-\frac {2 B}{\sqrt {\cot \left (d x +c \right )}}+\frac {\left (\frac {5 i A}{2}-\frac {9 B}{2}\right ) \cot \left (d x +c \right )^{\frac {3}{2}}+\left (-\frac {7 A}{2}-\frac {11 i B}{2}\right ) \sqrt {\cot \left (d x +c \right )}}{4 \left (i+\cot \left (d x +c \right )\right )^{2}}+\frac {\left (7 i A -23 B \right ) \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}+i \sqrt {2}}\right )}{4 \sqrt {2}+4 i \sqrt {2}}}{a^{2} d}\) | \(157\) |
default | \(\frac {-\frac {i \left (-i B +A \right ) \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}-i \sqrt {2}}\right )}{2 \left (\sqrt {2}-i \sqrt {2}\right )}-\frac {2 B}{\sqrt {\cot \left (d x +c \right )}}+\frac {\left (\frac {5 i A}{2}-\frac {9 B}{2}\right ) \cot \left (d x +c \right )^{\frac {3}{2}}+\left (-\frac {7 A}{2}-\frac {11 i B}{2}\right ) \sqrt {\cot \left (d x +c \right )}}{4 \left (i+\cot \left (d x +c \right )\right )^{2}}+\frac {\left (7 i A -23 B \right ) \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}+i \sqrt {2}}\right )}{4 \sqrt {2}+4 i \sqrt {2}}}{a^{2} d}\) | \(157\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 761 vs. \(2 (234) = 468\).
Time = 0.27 (sec) , antiderivative size = 761, normalized size of antiderivative = 2.39 \[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=-\frac {2 \, {\left (a^{2} d e^{\left (6 i \, d x + 6 i \, c\right )} + a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )}\right )} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{4} d^{2}}} \log \left (-\frac {2 \, {\left ({\left (i \, a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{2} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{4} d^{2}}} + {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) - 2 \, {\left (a^{2} d e^{\left (6 i \, d x + 6 i \, c\right )} + a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )}\right )} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{4} d^{2}}} \log \left (-\frac {2 \, {\left ({\left (-i \, a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{2} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{4} d^{2}}} + {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) - {\left (a^{2} d e^{\left (6 i \, d x + 6 i \, c\right )} + a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )}\right )} \sqrt {\frac {-49 i \, A^{2} + 322 \, A B + 529 i \, B^{2}}{a^{4} d^{2}}} \log \left (\frac {{\left ({\left (a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} - a^{2} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {-49 i \, A^{2} + 322 \, A B + 529 i \, B^{2}}{a^{4} d^{2}}} + 7 i \, A - 23 \, B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{2} d}\right ) + {\left (a^{2} d e^{\left (6 i \, d x + 6 i \, c\right )} + a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )}\right )} \sqrt {\frac {-49 i \, A^{2} + 322 \, A B + 529 i \, B^{2}}{a^{4} d^{2}}} \log \left (-\frac {{\left ({\left (a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} - a^{2} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {-49 i \, A^{2} + 322 \, A B + 529 i \, B^{2}}{a^{4} d^{2}}} - 7 i \, A + 23 \, B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{2} d}\right ) - 2 \, {\left (6 \, {\left (A + 7 i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} - {\left (A + 33 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, {\left (3 \, A + 5 i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}}{32 \, {\left (a^{2} d e^{\left (6 i \, d x + 6 i \, c\right )} + a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )}\right )}} \]
[In]
[Out]
Timed out. \[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
\[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\int { \frac {B \tan \left (d x + c\right ) + A}{{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{2} \cot \left (d x + c\right )^{\frac {5}{2}}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {A+B \tan (c+d x)}{\cot ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\int \frac {A+B\,\mathrm {tan}\left (c+d\,x\right )}{{\mathrm {cot}\left (c+d\,x\right )}^{5/2}\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^2} \,d x \]
[In]
[Out]